<template>
  <div class="">
    <header class="header">
      <h1>todos</h1>
      <input class="new-todo" placeholder="请输入任务名称" autofocus v-model="username" @keyup.enter ="increase"/>
    </header>
  </div>
</template>
<script>
export default {
  name: 'HmHeader',
  data () {
    return {
      username: '',
    }
  },
  methods: {
    increase () {
      if(this.username === '') return
      this.$emit('increase', this.username)
      this.username = ''
    }
  },
}
</script>
<style scoped></style>
